package models.ru.paralainer.chat.server.dto;

import models.ru.paralainer.chat.server.domain.User;

/**
 * Created By: Sergey Talov (serg.talov@gmail.com)
 * Date: 16.08.12
 * Time: 0:16
 */
public class UserDTO {

    protected String username;

    protected String name;

    protected String vkontakte;

    protected String email;

    public UserDTO() {
    }

    public UserDTO(User user) {
        this.username = user.getUsername();
        this.name = user.getName();
        this.vkontakte = user.getVkontakte();
        this.email = user.getEmail();
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVkontakte() {
        return vkontakte;
    }

    public void setVkontakte(String vkontakte) {
        this.vkontakte = vkontakte;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserDTO userDTO = (UserDTO) o;

        if (username != null ? !username.equals(userDTO.username) : userDTO.username != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return username != null ? username.hashCode() : 0;
    }
}
